<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="Generator" content="EditPlus" />
    <meta name="Author" content="" />
    <meta name="Keywords" content="" />
    <meta name="Description" content="" />
	<title>校内系统注册</title>
<script type="text/javascript">
   function showSchool()
   {
       var atype = document.getElementById('atype');
	   var oDivSchool = document.getElementById('div1');
	   if(atype.value=='1')
	    oDivSchool.style.display = 'block';
       else  oDivSchool.style.display = 'none';
   }

   window.onload = function()
   {
      var da = new Date();
	  var year = da.getYear();
	  year+=1900;
	  var oSel = document.getElementById('xuezhi');
	  for(var i=year;i>year-10;i--)
	  {
	     oSel.innerHTML+='<option value="'+i+'">'+i+'</option>';
	  }
	  getSchool();
	  var pass = document.getElementById('pass');
	  pass.onblur = cpass;
	  var rpass = document.getElementById('rpass');
	  rpass.onblur = crpass;
	  
	  var email_div = document.getElementById('email_d');
	  email_div.onblur = cemail;
	  
	}
function cpass()
	  {
	     if(this.value.length==0)
		 {
		    document.getElementById('passtext').innerHTML = '密码不能为空';
			return false;
		 }
		 document.getElementById('passtext').innerHTML = '';
		 return true;
	  }
function crpass()
{
   if(this.value.length==0)
   {
        document.getElementById('rpasstext').innerHTML = '重复密码不能为空';
		return false;
   }
   if(this.value!=pass.value)
   {
        document.getElementById('rpasstext').innerHTML = '两次密码不一致';
		return false;
   }
   document.getElementById('rpasstext').innerHTML = '';
   return true;
}
function cemail()
{
   if(this.value!=""&&this.value.match(/^[a-zA-Z0-9_.-]*@[0-9a-zA-Z]+(.[a-zA-Z]+)+$/)==null)
   {
      document.getElementById('email_div').innerHTML = '邮件格式不正确';
	  return false;
   }
   document.getElementById('email_div').innerHTML = '';   
   return true;
}
function checkide(ID){
	var xmlHttp;
	var str=document.getElementById("ID").value.trim();
	
	if(str.length==0)
	{
		document.getElementById("checkRet").innerHTML="请输入账号";
		return false;
	}
	
	if(window.XMLHttpRequest){
		xmlHttp=new XMLHttpRequest();
	}else{  
		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
	
	xmlHttp.onreadystatechange=function(){//服务器相应
		if (xmlHttp.readyState==4 && xmlHttp.status==200){
    		document.getElementById("checkRet").innerHTML=xmlHttp.responseText;
   	 	}
  	}
	xmlHttp.open("get","checkide.jsp?ID="+str,true);
    xmlHttp.send(null);    
	return true;
}
function getSchool()
{
   var xmlHttp;
   if(window.XMLHttpRequest){
		xmlHttp=new XMLHttpRequest();
   }else{  
		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
   }
   xmlHttp.onreadystatechange=function(){//服务器相应
		if (xmlHttp.readyState==4&&xmlHttp.status==200){
    		document.getElementById("school").innerHTML = xmlHttp.responseText;
   	 	}
  }
  xmlHttp.open("get","prov.jsp",true);
  xmlHttp.send(null);    
}
function lastchech()
{
  if(checkide('ID')&&cpass()&&crpass()&&cemail())
  {
     return true;
  }
  return false;
}
</script>
<style type="text/css">
#head{
width:inherit;
height:40px;
background-color:#0066FF;
margin-top:0px;
margin-right:0px;
margin-left:0px;
color:#000000;
font-family:"宋体";
font-size:18px;
}
.tishi{
position:absolute;
top:20px;
left:400px;
height:10px;
widths:233px;
background:#666666;}
.inp{
width:200px;
height:25px;}
.fo{
width:800px;
height:inherit;
border:1px solid #0000CC;
text-align:left;
font-size:16px;
padding-left:100px;}
.prople_img
{
width:100px;
height:120px;
background:#0099FF;}
</style>
</head>

<body>
   <div id="head"><br />
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;校内&nbsp;&nbsp;&nbsp;与朋友分享
	  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
   <a href="/xiaonei1227/dl.jsp" style="text-decoration:none"><font face="宋体" color="#000000">退出</font></a>
   </div>
   <center>
   <div class="fo">
      <form  method="post" id="a" action="register.jsp">
	  <h1>基本信息：</h1>
         <p>登陆帐号：<input  name="sno" type="text" maxlength="20"  class="inp" id='ID' onblur="checkide(ID)"><span id="checkRet" style="color:#FF0000; font-size:9px"></span></p>
         <p>密码：<input name="password1" type="password" maxlength="20" class="inp" id="pass"/><span id='passtext' style="color:#FF0000; font-size:9px"></span></p>
         <p>确认密码：<input name="password2" type="password" onChange="check()" class="inp" id="rpass"/><span id='rpasstext' style="color:#FF0000; font-size:9px"></span></p>
         <p>姓名：<input name="name" type="text" class="inp"></p>
         <p>昵称：<input  name="nickname" type="text"   class="inp"></p>
         <p>性别:&nbsp;&nbsp;&nbsp;<label>男<input name="sex" type="radio" value="m" checked="checked"/></label>
&nbsp;&nbsp;&nbsp;  <label>女<input name="sex" type="radio" value="f"/></label></p>
         <p>出生日期:&nbsp;&nbsp;&nbsp;<input type="date" name="birthday"/></p>
		<p>家庭住址:
			&nbsp;省<input name="pro" type="text" /> 
			&nbsp;市<input name="city" type="text" /> 
			&nbsp;县<input name="county" type="text" /> 
        </p>
		<p>感情状况：<select name="emotion">
		            <option value="单身">单身</option>
					<option value="求交往">求交往</option>
					<option value="热恋中">热恋中</option>
		        </select></p>
	<h1>联系信息：</h1>
		<p>手机号：<input name="phone" type="text" maxlength="11" class="inp"></p>
		<p>邮箱：<input name="email" type="text" class="inp" id="email_d"><span id='email_div' style="color:#FF0000; font-size:9px"></span></p>
		<p>帐号类型<select name="account_type"  id="atype" onchange="showSchool()">
		              <option  value="1">学生帐号</option>	
		              <option  value="2">社会帐号</option>
			       </select>
		 </p>
		 <p>简介<br /><textarea name="jian" rows='5' cols='100' wrap="off"></textarea>
	<div id="div1">		 
    <hr  width="700px" align="left"/>
	<h1>学校信息：</h1>	
	    <p>学校名称：<span id="school"></span></p>
		<p>所属院系：<input type="text"  class="inp" name="school"/></p>
		<p>学制 <select name="study_year">
		            <option value="1">1</option>
					<option value="2">2</option>
					<option value="3">3</option>
					<option value="4">4</option>
					<option value="5">5</option>
					<option value="6">6</option>
					<option value="7">7</option>
					<option value="8">8</option>
					<option value="9">9</option>
		        </select>
		</p>
		<p>年级：<select name="grade" id='xuezhi'>										
		         </select>
	    </p>
		<p>专业:<input type="text"  class="inp" name="speciality"/></p>
	</div>
	<input  value="提交" type="submit" onclick="lastchech()"/>
   </form>
</div>
</center>
</body>
</html>
